﻿using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace Tetris.Utility
{
    public class GraphicUtils
    {
        public static Texture2D CreateRectangle(Game game, int width, int height, Color colori)
        {
            var rectangleTexture = new Texture2D(game.GraphicsDevice, width, height, false, SurfaceFormat.Color);
            var color = new Color[width * height];
            for (var i = 0; i < color.Length; i++)
            {
                color[i] = colori;
            }
            rectangleTexture.SetData(color);
            return rectangleTexture;
        }
    }
}
